import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Moneda here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Moneda extends Bonos
{
    private int valor;
    private int animationCounter;
    private final GreenfootImage coinL = new GreenfootImage("coin.png");
    private final GreenfootImage coinR = new GreenfootImage(coinL);
    
    public Moneda(){
        animationCounter = 0;
        coinR.mirrorHorizontally();
    }
    
    /**
     * Act - do whatever the Moneda wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        animacion();
        //checaColision();
    }   
  
          
    public void animacion(){
        animationCounter ++;
        if(animationCounter < 20)   
            setImage(coinR);
         else if(animationCounter < 40)
               setImage(coinL);
         else   if(animationCounter == 40)
                 animationCounter = 0;
    }
}
